#!C:\python25\python.exe
# -*- coding: GB18030 -*-

from xmlParser import CParserHandler
from xml.sax import parse, SAXParseException, ContentHandler
from xmlData import CAllData

def main():
    #if os.path.exists("csdt110001_rpt.h") :
    #    os.remove("csdt110001_rpt.h")
    #fp = open("csdt110001_rpt.h", "a+")

	DictDetail = CAllData()
	#parser = CParserHandler(DictDetail)

	try:
		parse( "ctdt110001_rpt.xml", CParserHandler(DictDetail) )
	except IOError, message:
		print "Error reading csdt110001_rpt.xml file:", message
	except SAXParseException, message:
		print "Error parsing csdt110001_rpt.xml file:", message

	DictDetail.printValue()

if __name__ == "__main__":
    main()
